import requests
"""
# 接口地址：https://www.httpbin.org/delete
# 请求方法：delete
# 参数：num、test
# 响应类型：json
url = 'https://www.httpbin.org/delete'
# delete请求和get请求一样
params = {'num': 1, 'test': 'tedu'}
resp = requests.delete(url, params=params)
print('请求的URL：', resp.request.url)
print('响应体：', resp.json())
"""
# 接口地址：https://www.httpbin.org/put
# 请求方法：put
# 参数类型：json字符串
# 参数：phone、email
# 响应类型：json
url = 'https://www.httpbin.org/put'
json_data = {'phone': '18812345678', 'email': '123@qq.com'}
resp = requests.put(url, json=json_data)
print('请求头：', resp.request.headers)
print('请求体：', resp.request.body)
print('响应体：', resp.json())
